<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/ajax.js"></script>
</head>

<body>

</body>
<script>
    // 构造函数本身自带方法      (对比Array.isArray())
    // Promise.all()  
    // Promise.race()  
    // Promise.allSettled()  
    // Promise.resolve()  
    // 1. 传入一个参数(非Promise对象)  => 快速返回成功状态的Promise实例,(参数会存储到实例的结果中)


    // Promise.reject()  
    // 1. 传入一个参数(非Promise对象)  => 快速返回失败状态的Promise实例,(参数会存储到实例的结果中)

    /* var p = new Promise(function (resolve, reject) {
        resolve(1);
    })

    Promise.myResolve = function (arg) {
        var p = new Promise(function (resolve, reject) {
            resolve(arg);
        })
        return p;
    } */

    var p = Promise.resolve(1);
    console.log(p);



    /* var p1 = new Promise(function (resolve, reject) {
        reject(1);
    })

    Promise.myReject = function (arg) {
        var p = new Promise(function (resolve, reject) {
            reject(arg);
        })
        return p;
    } */

    var p = Promise.reject(1);
    console.log(p);


</script>

</html>